<Window x:Class="PowerPatcher.MainWindow"
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
        xmlns:WinForms="clr-namespace:System.Windows.Forms;assembly=System.Windows.Forms"
        xmlns:p="clr-namespace:PowerPatcher.Properties"
        xmlns:my="clr-namespace:PowerPatcher"
        Name="PPWindow"
        Title="{x:Static my:Msgs.PowerPatcher}" Height="622" Width="732" HorizontalContentAlignment="Stretch" VerticalContentAlignment="Stretch" Loaded="Window_Loaded" Icon="/Mabinogi;component/Images/Icon.ico" Closed="PPWindow_Closed">
    <Window.Resources>
        <Thickness x:Key="dMargin">0,0,0,4</Thickness>
    </Window.Resources>
    <Grid>
        <Grid.Background>
            <LinearGradientBrush EndPoint="0.5,1" StartPoint="0.5,0">
                <GradientStop Color="#FFC19A6B" Offset="0" />
                <GradientStop Color="#FFFFDAC2" Offset="0.82" />
                <GradientStop Color="#FFEFEFEF" Offset="1" />
            </LinearGradientBrush>
        </Grid.Background>
        <Grid.RowDefinitions>
            <RowDefinition Height="371" />
            <RowDefinition Height="*" />
    		<RowDefinition Height="100" />
        </Grid.RowDefinitions>
        <TabControl Padding="4" Name="TabHost" SelectionChanged="TabHost_SelectionChanged" Height="371" Background="Transparent">
            <TabItem Name="Startup" Header="Startup" >
                <Grid Background="{x:Null}">
                    <Grid>
                        <Grid.ColumnDefinitions>
                            <ColumnDefinition />
                            <ColumnDefinition />
                        </Grid.ColumnDefinitions>
                        <WindowsFormsHost Grid.Column="1" Name="rFrame">
                            <WinForms:WebBrowser WebBrowserShortcutsEnabled="False" IsWebBrowserContextMenuEnabled="False" />
                        </WindowsFormsHost>
                        <WindowsFormsHost Grid.Column="0" Name="lFrame">
                            <WinForms:WebBrowser ScrollBarsEnabled="False" WebBrowserShortcutsEnabled="False" IsWebBrowserContextMenuEnabled="False" />
                        </WindowsFormsHost>
                    </Grid>
                </Grid>
            </TabItem>
            <TabItem Name="Settings" Header="{x:Static my:Msgs.Settings}">
        		<Grid>
                    <Grid.RowDefinitions>
                        <RowDefinition Height="Auto" />
                        <RowDefinition Height="Auto" />
                        <RowDefinition Height="Auto" />
                        <RowDefinition Height="Auto" />
                        <RowDefinition Height="Auto" />
                        <RowDefinition Height="Auto" />
                        <RowDefinition />
                    </Grid.RowDefinitions>
                    <Grid Grid.Row="0">
                        <Grid.ColumnDefinitions>
                            <ColumnDefinition Width="Auto" />
                            <ColumnDefinition Width="*" />
                        </Grid.ColumnDefinitions>
                        <Grid.RowDefinitions>
                            <RowDefinition Height="Auto" />
                            <RowDefinition Height="Auto" />
                        </Grid.RowDefinitions>
                        <Label Grid.Row="0" Grid.Column="0" Content="{x:Static my:Msgs.LeftStartupWebsite}" />
                        <TextBox Grid.Row="0" Grid.Column="1" Text="{Binding Source={x:Static p:Settings.Default}, Path=LeftURL, Mode=TwoWay}" />
                        <Label Grid.Row="1" Grid.Column="0" Content="{x:Static my:Msgs.RightStartupWebsite}" />
                        <TextBox Grid.Row="1" Grid.Column="1" Text="{Binding Source={x:Static p:Settings.Default}, Path=RightURL, Mode=TwoWay}" />
                    </Grid>
                    <CheckBox Grid.Row="1" IsChecked="{Binding Source={x:Static p:Settings.Default}, Path=RequireAdministrator, Mode=TwoWay}" Margin="{StaticResource dMargin}" Content="{x:Static my:Msgs.PatcherrequiresAdministratorpermissions}" />
                    <CheckBox Grid.Row="2" IsChecked="{Binding Source={x:Static p:Settings.Default}, Path=ShowDetailedErrors, Mode=TwoWay}" Margin="{StaticResource dMargin}" Content="{x:Static my:Msgs.ShowdetailedErrorMessages}" />
                    <Label Grid.Row="3" Content="{x:Static my:Msgs.Notifyofupdatesforbuildsrated}"/>
                    <ComboBox Name="UpdateLvlCombo" Grid.Row="3" SelectedValuePath="Content" SelectedValue="{Binding Source={x:Static p:Settings.Default}, Path=UpdateLevel, Mode=TwoWay}" HorizontalAlignment="Left" VerticalAlignment="Center" Margin="185,2,0,4" Width="60">
                        <ComboBoxItem Content="{x:Static my:Msgs.Stable}" />
                        <ComboBoxItem Content="{x:Static my:Msgs.Beta}" />
                        <ComboBoxItem Content="{x:Static my:Msgs.Alpha}" />
                    </ComboBox>
                    <Label Grid.Row="3" Margin="245,0,0,0" HorizontalAlignment="Left" Content="{x:Static my:Msgs.orhigher}"/>
                    <Label Grid.Row="4" Content="{x:Static my:Msgs.ClientStartArguments}" />
                    <TextBox Grid.Row="4" Text="{Binding Source={x:Static p:Settings.Default}, Path=ClientStartArgs, Mode=TwoWay}" HorizontalAlignment="Left" VerticalAlignment="Top" Margin="131,2,0,4" Width="569" />              
                    <Label Grid.Row="5" Content="{x:Static my:Msgs.Language}"/>
                    <ComboBox Name="langs" Grid.Row="5" Width="619" Margin="81,0,0,0" ItemsSource="{Binding}" SelectionChanged="langs_SelectionChanged" />
                </Grid>
        	</TabItem>
        </TabControl>
		<Grid Grid.Row="1">
    		<Grid.ColumnDefinitions>
                <ColumnDefinition Width="Auto" />
                <ColumnDefinition Width="Auto" />
                <ColumnDefinition Width="113*" />
				<ColumnDefinition Width="76" />
				<ColumnDefinition Width="167" />
				<ColumnDefinition Width="188" />
			</Grid.ColumnDefinitions>
            <Label Name="cVersionText" Grid.Column="0" VerticalAlignment="Bottom" Content="{x:Static my:Msgs.ClientVersion1}" />
            <Label Name="ClientVersLabel" Grid.Column="1" VerticalAlignment="Bottom" Content="-1" />
            <Label Name="PatcherVersLabel" Grid.Column="2" VerticalAlignment="Bottom" Content="{x:Static my:Msgs.LauncherVersion0}" />
            <Grid Grid.Column="3">
                <Grid.RowDefinitions>
                    <RowDefinition />
                    <RowDefinition />
                </Grid.RowDefinitions>
    		    <Button Grid.Row="0" Click="Button_Click" Content="{x:Static my:Msgs.PatchAll}"/>
            </Grid>
            <CheckBox Grid.Column="4" HorizontalAlignment="Center" IsChecked="{Binding Source={x:Static p:Settings.Default}, Path=StartAfterPatch, Mode=TwoWay}" Content="{x:Static my:Msgs.StartGameafterPatch}"/>
    		<Button Grid.Column="5" Content="{x:Static my:Msgs.StartGame}" FontWeight="Normal" FontSize="30" Click="StartGame"/>
    	</Grid>
		<Grid Grid.Row="2">
    		<Grid.RowDefinitions>
				<RowDefinition Height="*" />
				<RowDefinition Height="*" />
				<RowDefinition Height="*" />
			</Grid.RowDefinitions>
    		<Grid.ColumnDefinitions>
				<ColumnDefinition Width="200" />
				<ColumnDefinition Width="*" />
			</Grid.ColumnDefinitions>
            <ProgressBar Grid.Column="0" Grid.Row="0" Name="SubProg2Bar" Foreground="#FF00FFFC" Maximum="1" SmallChange="0.01" />
    	    <Label Grid.Column="1" Grid.Row="0" Name="SubProg2Lab" />
            <ProgressBar Grid.Column="0" Grid.Row="1" Name="SubProg1Bar" Foreground="#FF00FFFC" Maximum="1" SmallChange="0.01"/>
    	    <Label Grid.Column="1" Grid.Row="1" Name="SubProg1Lab" />
            <ProgressBar Grid.Column="0" Grid.Row="2" Name="MainProgBar" Foreground="Lime" Maximum="1" SmallChange="0.01"/>
    	    <Label Grid.Column="1" Grid.Row="2" Name="MainProgLab" />
    	</Grid>
    </Grid>
</Window>
